<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>绝对定位</title>
  <style>
    .card {
      position: relative;

      width: 240px;
      height: 240px;
      background-color: #d8d8d8;
    }

    .card>img {
      width: 100%;
    }

    .card .tip {
      position: absolute;
      top: 0;
      right: 0;
      width: 80px;
      height: 32px;
      text-align: center;
      line-height: 32px;
      color: #fff;
      background-color: rgba(0, 0, 0, 0.5);
    }
  </style>
</head>

<body>
  <div class="card">
    <img src="../../素材/images/dog1.webp" alt="">
    <span class="tip">VIP</span>
  </div>
</body>

</html>